From 19b7c20006b9b4085ce60e64d744b488f1e8cc84 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Tue, 1 Feb 2005 00:35:28 +0000 Subject: [PATCH] Fix #913 : Nostalgia skin no more using isSysop() and isDeveloper() --- includes/Skin.php | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index 1b60a942b4..33b4a7e790 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -869,26 +869,29 @@ class Skin extends Linker { * @TODO crash bug913. Need to be rewrote completly. */ function specialPagesList() { - global $wgUser, $wgOut, $wgContLang, $wgServer, $wgRedirectScript; + global $wgUser, $wgOut, $wgContLang, $wgServer, $wgRedirectScript, $wgAvailableRights; require_once('SpecialPage.php'); $a = array(); $pages = SpecialPage::getPages(); + // special pages without access restriction foreach ( $pages[''] as $name => $page ) { $a[$name] = $page->getDescription(); } - if ( $wgUser->isSysop() ) - { - foreach ( $pages['sysop'] as $name => $page ) { - $a[$name] = $page->getDescription(); - } - } - if ( $wgUser->isDeveloper() ) - { - foreach ( $pages['developer'] as $name => $page ) { - $a[$name] = $page->getDescription() ; + + // Other special pages that are restricted. + // Copied from SpecialSpecialpages.php + foreach($wgAvailableRights as $right) { + if( $wgUser->isAllowed($right) ) { + /** Add all pages for this right */ + if(isset($pages[$right])) { + foreach($pages[$right] as $name => $page) { + $a[$name] = $page->getDescription(); + } + } } } + $go = wfMsg( 'go' ); $sp = wfMsg( 'specialpages' ); $spp = $wgContLang->specialPage( 'Specialpages' ); @@ -898,6 +901,7 @@ class Skin extends Linker { $s .= "